﻿Imports System.Data.OleDb

Public Class AddVideo2
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        tb_User.Text = User.Identity.Name
    End Sub

    Protected Sub btn_Upload_Click(sender As Object, e As EventArgs) Handles btn_Upload.Click
        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("3dBuzzDatabase").ConnectionString)

        Dim findIdsqlString As String = "SELECT  aspnet_Users.[UserId] from aspnet_Users WHERE aspnet_Users.UserName = @f20"
        Dim findcmd As OleDbCommand = New OleDbCommand(findIdsqlString, oleDbConn)
        findcmd.CommandType = CommandType.Text
        findcmd.Parameters.AddWithValue("@f20", User.Identity.Name)
        oleDbConn.Open()
        Dim dataReader As OleDbDataReader = findcmd.ExecuteReader()
        Dim storeid As Integer

        dataReader.Read()
        storeid = dataReader.Item("UserId")

        Dim sqlString As String = "INSERT into Video (Showreel, ArtistId, Title, Description) VALUES (@f1, @f2, @f3, @f4)"
        'Dim cmd As OleDbCommand = New OleDbCommand(sqlString, oleDbConn)
        'cmd.CommandType = CommandType.Text
        'cmd.Parameters.AddWithValue("@f1", "videos/" & f_Video.FileName)
        'cmd.Parameters.AddWithValue("@f2", storeid)
        ' cmd.Parameters.AddWithValue("@f3", tb_Title.Text)
        'cmd.Parameters.AddWithValue("@f4", tb_Desc.Text)


        ' cmd.ExecuteNonQuery()
        ' Response.Redirect("~/Artists.aspx")





    End Sub
End Class